package lab.cadl.lirui.markdown.gui

import javafx.scene.image.Image
import javafx.stage.Stage
import lab.cadl.lirui.markdown.core.Main
import org.apache.logging.log4j.core.config.ConfigurationSource
import org.apache.logging.log4j.core.config.Configurator
import tornadofx.*

class MarkdownGuiApp: App(MainView::class) {
    override fun start(stage: Stage) {
        super.start(stage)
        val image = Image(MainView::class.java.classLoader.getResourceAsStream("icons/m_64.png"))
        println("${image.width}, ${image.height}")
        FX.primaryStage.icons += image
    }
}

fun main(args: Array<String>) {
    val source = ConfigurationSource(Main::class.java.getResourceAsStream("log4j2.xml"))
    Configurator.initialize(null, source)

    launch<MarkdownGuiApp>(args)
}